<?php
namespace app\home\model;

use think\Model;

class Reply extends Model {
    public function index()
    {
        # code...
        
    }
    public function member()
    {
        # code...
        
        return $this->belongsTo('user', 'userid', 'id')->field('username,avatar,id,title,sex,staus');
    }
    public function getRidAttr($vue)
    {
        # code...
        if (!empty($vue)) {
            $data = $this->where('id',$vue)->select()->toArray()[0];
            $data['userid'] = model('user')->field('username')->select($data['userid'])->toArray()[0];
            return $vue = $data;
        }else {
            return $vue = 'false';
        }
    }
}